import request from '@/utils/request'

// 获取菜单
export const reqGetMenuToAssignListAsync = () => {
  return request.get(`/admin/acl/permission`)
}

// 根据角色获取菜单
export const reqGetRoleMenuToAssignAsync = (roleId) => {
  return request.get(`/admin/acl/permission/toAssign/${roleId}`)
}
// 给角色分配权限
export const reqAllocationRolePermissionAsync = (permissionVo) => {
  return request.post(`/admin/acl/permission/doAssignAcl`, permissionVo)
}
// 新增菜单
export const reqAddMenuAsync = (permission) => {
  return request.post(`/admin/acl/permission/save`, permission)
}
// 修改菜单
export const reqUpdateMenuAsync = (permission) => {
  return request.put(`/admin/acl/permission/update`, permission)
}
// 删除菜单
export const reqDeleteMenuAsync = (id) => {
  return request.delete(`/admin/acl/permission/remove/${id}`)
}

